Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust drive definition from unix time range to openpilot route #486

Merged
merged 19 commits into from
Jun 18, 2024

Conversation

0x7B5
Copy link
Contributor

@0x7B5 0x7B5 commented May 31, 2024

fixes #473

@0x7B5 0x7B5 reopened this Jun 1, 2024
@adeebshihadeh
Copy link
Contributor

Merged the new demo account. Should help with testing this.

Copy link

github-actions bot commented Jun 10, 2024

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

deployed preview: https://486.connect-d5y.pages.dev

@0x7B5
Copy link
Contributor Author

0x7B5 commented Jun 14, 2024

  • Changed urls to use log ids
  • Updated zoom and loop to be in relative time, added functionality to set them relative to log id
  • Redirect old urls to log_ids
  • Updated components to use relative time
  • Updated tests
  • Updated analytics to use relative time

@0x7B5 0x7B5 marked this pull request as ready for review June 14, 2024 20:16
@0x7B5 0x7B5 changed the title [WIP] Adjust drive definition from unix time range to openpilot route Adjust drive definition from unix time range to openpilot route Jun 14, 2024
@adeebshihadeh
Copy link
Contributor

adeebshihadeh commented Jun 14, 2024

Ready for review? Want to post the preview link in Discord for people to stress test?

@0x7B5
Copy link
Contributor Author

0x7B5 commented Jun 14, 2024

Yes, will do

Copy link
Contributor

@adeebshihadeh adeebshihadeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, left some minor comments. Nice to see that this ended up being a red diff in terms of lines and not just complexity!

return null;
}

return Math.floor(offset / (60*1000));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't quite correct: log rotation bugs, missing segments, etc. however i think it's good enough for now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't currently listed in the docs for derived data, but we recently started generating a file that gives you the first and last frame time of each segment relative to the start of the route named frame_times.json.

The file is similar to the GPS data points, but at the route level, for example:

https://chffrprivate.azureedge.net/chffrprivate3/v2/cb38263377b873ee/78392b99580c5920227cc5b43dff8a70_2017-06-12--18-51-47/frame_times.json

src/__puppeteer__/drive.test.js Outdated Show resolved Hide resolved
src/timeline/segments.js Outdated Show resolved Hide resolved
src/components/DriveVideo/index.jsx Outdated Show resolved Hide resolved
@0x7B5
Copy link
Contributor Author

0x7B5 commented Jun 15, 2024

Resolved issues

Copy link
Contributor

@sshane sshane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For routes without the correct time (too short, no internet, something wrong), can you sort by upload time? @adeebshihadeh will add new outputs to the API shortly for create_time (upload time). Right now it uses device time

@sshane
Copy link
Contributor

sshane commented Jun 15, 2024

I clicked on "Last week" to filter, and it started opening a few routes randomly, with no change to the URL (still only shows dongle).

@sshane
Copy link
Contributor

sshane commented Jun 15, 2024

Also, when loading a route from URL on a device with >hundreds of routes, it seems to wait for the routes_segments query to complete which is very slow (fixable by reducing that and doing infinite scrolling I believe).

On routes without start_time, it also never loaded, but that may be okay as the routes I tested also only had one qlog and no qcameras

@0x7B5
Copy link
Contributor Author

0x7B5 commented Jun 17, 2024

Also, when loading a route from URL on a device with >hundreds of routes, it seems to wait for the routes_segments query to complete which is very slow (fixable by reducing that and doing infinite scrolling I believe).

On routes without start_time, it also never loaded, but that may be okay as the routes I tested also only had one qlog and no qcameras

Are you referring to when you go to an old url like "https://connect.comma.ai/1d3dc3e03047b0c7/1716477480803/1716478866821" and it redirects? Or route url loading in general?

@0x7B5
Copy link
Contributor Author

0x7B5 commented Jun 18, 2024

  • Sort routes by create_time
  • Fixed routes popping up on changing time filter (had to do with not nulling out segmentRange state)

@adeebshihadeh
Copy link
Contributor

@adeebshihadeh adeebshihadeh merged commit 28e7653 into commaai:master Jun 18, 2024
4 checks passed
@adeebshihadeh
Copy link
Contributor

Merged anyway to start getting feedback

@0x7B5
Copy link
Contributor Author

0x7B5 commented Jun 18, 2024

Comment on lines -21 to -22
if (pathZoom !== state.zoom) {
dispatch(pushTimelineRange(pathZoom?.start, pathZoom?.end, false));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0x7B5 this used to reset the timeline zoom points when you pressed back in the browser, but below I don't think ever executes anymore, or at least not in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[$500 bounty] Adjust drive definition from unix time range to openpilot route
4 participants